package com.sgb.kjwl.viewmodel.self.publish;

import com.sgb.kjwl.api.APIManager;
import com.sgb.kjwl.model.entity.self.LeaseMemberDetailEntity;
import com.swgk.core.base.api.ICallBack;
import com.swgk.core.base.model.entity.BaseEntity;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class LeaseMemberPriceAddModel extends ViewModel {
    //public LeaseMemberDetailEntity bean = new LeaseMemberDetailEntity();
    public MutableLiveData<LeaseMemberDetailEntity> showDetailLiveData = new MutableLiveData<>();//详情数据
    public MutableLiveData<String> msgLiveData = new MutableLiveData<>();

    //  发布求租信息
    public void addMember(LeaseMemberDetailEntity bean) {
        APIManager.getInstance().getLeaseAPI().leaseVipAdd(bean).enqueue(new ICallBack<BaseEntity>() {
            @Override
            public void onSuccess(BaseEntity data) {
                msgLiveData.postValue("操作成功");
            }
        });
    }

    public void getMemberDetail(String module, String no) {
        APIManager.getInstance().getLeaseAPI().getLeaseVipDetail(module,no).enqueue(new ICallBack<BaseEntity<LeaseMemberDetailEntity>>() {
            @Override
            public void onSuccess(BaseEntity<LeaseMemberDetailEntity> data) {
                showDetailLiveData.postValue(data.getData());
            }
        });
    }

}
